import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class OrderAggregatesVo {

  List<OrderAggregatesItem>? data;
  OrderAggregatesMeta? meta;

  OrderAggregatesVo({this.data, this.meta});

  OrderAggregatesVo.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = <OrderAggregatesItem>[];
      json['data'].forEach((v) {
        data!.add(new OrderAggregatesItem.fromJson(v));
      });
    }
    meta = json['meta'] != null ? new OrderAggregatesMeta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.meta != null) {
      data['meta'] = this.meta!.toJson();
    }
    return data;
  }
}

class OrderAggregatesItem {
  String? accountName;
  String? cardNumber;
  String? mobile;
  String? totalAmount;
  String? bank;
  int? number;
  int? openStatus;
  List<Orders>? orders;

  OrderAggregatesItem(
      {this.accountName,
      this.cardNumber,
      this.mobile,
      this.totalAmount,
      this.bank,
      this.number,
      this.orders,
      this.openStatus});

  OrderAggregatesItem.fromJson(Map<String, dynamic> json) {
    accountName = json['account_name'];
    cardNumber = json['card_number'];
    mobile = json['mobile'];
    totalAmount = json['total_amount'];
    bank = json['bank'];
    number = json['number'];
    openStatus = json['openStatus'];
    if (json['orders'] != null) {
      orders = <Orders>[];
      json['orders'].forEach((v) {
        orders!.add(new Orders.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['account_name'] = this.accountName;
    data['card_number'] = this.cardNumber;
    data['mobile'] = this.mobile;
    data['total_amount'] = this.totalAmount;
    data['bank'] = this.bank;
    data['number'] = this.number;
    data['orders'] = this.orders;
    data['openStatus'] = this.openStatus;
    if (this.orders != null) {
      data['orders'] = this.orders!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Orders {
  String? orderSn;
  String? totalAmount;

  Orders({this.orderSn, this.totalAmount});

  Orders.fromJson(Map<String, dynamic> json) {
    orderSn = json['order_sn'];
    totalAmount = json['total_amount'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['order_sn'] = this.orderSn;
    data['total_amount'] = this.totalAmount;
    return data;
  }
}

class OrderAggregatesMeta {

  CommonPagination? pagination;

  OrderAggregatesMeta({this.pagination});

  OrderAggregatesMeta.fromJson(Map<String, dynamic> json) {
    pagination = json['pagination'] != null
        ? new CommonPagination.fromJson(json['pagination'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
    return data;
  }
}